﻿<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="GesturesViewer.MainWindow"
        Loaded="Window_Loaded"
        Closing="Window_Closing"        
        WindowState="Normal"    
        Title="Gestures Viewer" Height="700" Width="1000" MinHeight="700" MinWidth="1000" MaxHeight="700" MaxWidth="1000">
    <Window.Resources>
        <Style TargetType="{x:Type TextBlock}">
            <Setter Property="FontFamily" Value="Segoe UI"/>
            <Setter Property="FontSize" Value="20"/>
            <Setter Property="Foreground" Value="#FF999999"/>
        </Style>
        <Style TargetType="{x:Type Button}">
            <Setter Property="FontFamily" Value="Segoe UI"/>
            <Setter Property="FontSize" Value="20"/>
            <Setter Property="Width" Value="200"/>
        </Style>
        <Style TargetType="{x:Type CheckBox}">
            <Setter Property="FontFamily" Value="Segoe UI"/>
            <Setter Property="FontSize" Value="20"/>
        </Style>
    </Window.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
            <ColumnDefinition Width="250"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="300"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="100"/>
            <RowDefinition Height="30"/>
            <RowDefinition Height="100"/>
            <RowDefinition Height="*" MinHeight="30"/>
        </Grid.RowDefinitions>
        <Rectangle Grid.RowSpan="7">
            <Rectangle.Fill>
                <LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
                    <GradientStop Color="#FFCECECE" Offset="0"/>
                    <GradientStop Color="#FFDEDEDE" Offset="0.8"/>
                    <GradientStop Color="White" Offset="1"/>
                </LinearGradientBrush>
            </Rectangle.Fill>
        </Rectangle>
        <Viewbox Margin="5" Grid.RowSpan="6">
            <Grid Width="640" Height="480" ClipToBounds="True">
                <Image x:Name="kinectDisplay" Source="{Binding Bitmap}"/>
                <Canvas x:Name="kinectCanvas"/>
                <Canvas x:Name="gesturesCanvas"/>
                <Rectangle Stroke="Black" StrokeThickness="1"/>
            </Grid>
        </Viewbox>
        <TextBlock Text="COMMANDS" Grid.Column="1" Margin="4"/>
        <Grid Margin="10" Grid.Column="1" Grid.Row="1">
            <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition/>
                <RowDefinition/>
                <RowDefinition/>
                <RowDefinition/>
                <RowDefinition/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                <CheckBox Content="Audio" x:Name="audioControl" VerticalAlignment="Center" d:LayoutOverrides="Width"/>
                <Button Content="Record" x:Name="recordOption" Click="recordOption_Click" VerticalAlignment="Center" Width="129" Margin="10,6,0,6"/>
            </StackPanel>
            <Button Content="Replay" x:Name="replayButton" Click="replayButton_Click" VerticalAlignment="Center" Grid.Row="1" Width="Auto"/>
            <Button Content="Capture Gesture" x:Name="recordGesture" Click="recordGesture_Click" VerticalAlignment="Center" Grid.Row="2" Width="Auto"/>
            <Button Content="Capture T" x:Name="recordT" Click="recordT_Click" VerticalAlignment="Center" Grid.Row="3" Width="Auto"/>
            <CheckBox Content="Near Mode" x:Name="nearMode" Grid.Row="4" VerticalContentAlignment="Top" Checked="nearMode_Checked_1" Unchecked="nearMode_Unchecked_1"/>
            <CheckBox Content="Seated Mode" x:Name="seatedMode" Grid.Row="5" VerticalContentAlignment="Top" Checked="seatedMode_Checked_1" Unchecked="seatedMode_Unchecked_1"/>
            <CheckBox Content="Control Mouse" x:Name="controlMouse" Grid.Row="6" VerticalContentAlignment="Top"/>
        </Grid>
        <TextBlock Text="DETECTED GESTURES" Grid.Column="1" Grid.Row="2" Margin="4"/>
        <ListBox x:Name="detectedGestures" FontSize="20" Grid.Column="1" Margin="10,10,10,0" Grid.Row="3"/>
        <StackPanel Grid.Row="6" Margin="212,0" HorizontalAlignment="Center" VerticalAlignment="Center">
            <Rectangle x:Name="audioBeamAngle" Height="20" Width="300" Margin="5">
                <Rectangle.Fill>
                    <LinearGradientBrush StartPoint="0,0" EndPoint="1, 0">
                        <LinearGradientBrush.GradientStops>
                            <GradientStopCollection>
                                <GradientStop Offset="0" Color="Black"/>
                                <GradientStop Offset="{Binding BeamAngle}" Color="Orange"/>
                                <GradientStop Offset="1" Color="Black"/>
                            </GradientStopCollection>
                        </LinearGradientBrush.GradientStops>
                    </LinearGradientBrush>
                </Rectangle.Fill>
            </Rectangle>
            <StackPanel Orientation="Horizontal" />
        </StackPanel>
        <TextBlock Text="STABILITIES" Grid.Column="1" Grid.Row="4" />
        <ListBox x:Name="stabilitiesList" FontSize="20" Grid.Column="1" Grid.Row="5" Margin="10" Grid.RowSpan="2">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="{Binding Key}"/>
                        <TextBlock Text=": "/>
                        <TextBlock Text="{Binding Value}"/>
                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
        <Slider Minimum="{Binding ElevationMinimum}" Maximum="{Binding ElevationMaximum}" Value="{Binding ElevationAngle, Mode=TwoWay}" x:Name="elevationSlider" Orientation="Vertical" Grid.RowSpan="7"/>
        <Button Grid.RowSpan="2" Content="View Depth" Margin="267,10,267,0" HorizontalAlignment="Center" VerticalAlignment="Top" Click="Button_Click" x:Name="viewButton"/>
    </Grid>
</Window>
